module.exports = {
  toFortunetellerDetail: function(fid) {
    wx.navigateTo({
      url: "/pages/detail/fortuneteller-detail?fid=" + fid
    });
  },
  toAppoint: function(serviceId, price, duration, serviceName) {
    wx.navigateTo({
      url:
        "/pages/appoint/appoint?serviceId=" +
        serviceId +
        "&price=" +
        price +
        "&duration=" +
        duration +
        "&serviceName=" +
        serviceName
    });
  },
  toIntroduce: function(service, fortuneteller) {
    wx.navigateTo({
      url: "/pages/introduce/introduce",
      success: function(res) {
        // 通过eventChannel向被打开页面传送数据
        res.eventChannel.emit("service", service);
        res.eventChannel.emit("fortuneteller", fortuneteller);
      }
    });
  },
  toOrders: function() {
    wx.navigateTo({
      url: "/pages/orders/orders"
    });
  },
  redirectToOrders() {
    wx.redirectTo({
      url: "/pages/orders/orders"
    });
  },
  toMoney: function() {
    wx.navigateTo({
      url: "/pages/money/money"
    });
  },
  toWebview: function(cid,serviceId,path,module,fid) {
    wx.navigateTo({
      url: "/pages/webview/webview?cid="+cid+"&serviceId="+serviceId+"&path="+path+"&module="+module+"&fid="+fid
    });
  },
  toWallets: function() {
    wx.navigateTo({
      url: "/pages/wallets/wallets"
    });
  },
  toChat: function(conversationID, userID,avatar) {
    wx.navigateTo({
      url:
        "/pages/chat/chat?conversationID=" +
        conversationID +
        "&userID=" +
        userID +
          "&avatar=" +
          avatar
    });
  },
  toQuestions: function() {
    wx.navigateTo({
      url: "/pages/questions/questions"
    });
  },
  toChatRecord: function(id) {
    wx.navigateTo({
      url: "/pages/chat-record/chat-record?id="+id
    });
  }
};
